using UnityEngine;

public class TickMove : MonoBehaviour
{
	public Transform m_transform;

	public UISprite[] ticks;

	public float rotationZ;

	public float maxval;

	public bool isspeed;

	private void Start()
	{
		m_transform = base.transform;
	}

	public void scrollmove(float val)
	{
		if (val < 0f)
		{
			return;
		}
		if (isspeed)
		{
			rotationZ = val / 8f / maxval * 50f;
			m_transform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, rotationZ));
			for (int i = 0; i < ticks.Length; i++)
			{
				if (Mathf.Abs(rotationZ - (float)(-20 + 10 * i)) < 30f)
				{
					ticks[i].enabled = true;
				}
				else
				{
					ticks[i].enabled = false;
				}
			}
			return;
		}
		rotationZ = (0f - val) / 2f / maxval * 50f;
		m_transform.localRotation = Quaternion.Euler(new Vector3(0f, 0f, rotationZ));
		for (int j = 0; j < ticks.Length; j++)
		{
			if (Mathf.Abs(rotationZ - (float)(-80 + 10 * j)) < 30f)
			{
				ticks[j].enabled = true;
			}
			else
			{
				ticks[j].enabled = false;
			}
		}
	}
}
